#include<iostream>
#include<map>
#include<cmath>
#include<queue>
#include<string>
#include<math.h>
#include<stack>
#include<vector>
#include<set>
#include<unordered_map>
using namespace std;
int main()
{
    map<string, string> dict;
    dict.insert({ "dsa","dsaa" });
    for (const auto& e : dict)
        cout << e.first <<':'<<e.second<< endl;
    pair<string, string> kv1 = { "sss","ddd" };
    dict.insert(kv1);
    dict.insert(pair<string, string> {"www", "eee"});
    dict.insert(make_pair( "hhh","kkk" ));
    map<string, string>::iterator it = dict.begin();
    while (it != dict.end())
    {
        cout << (*it).first << ':' << it->second << endl;
        it++;
    }
    for (const auto& e : dict)
        cout << e.first << ':' << e.second << endl;
    for (const auto& [k,v]: dict)//结构化绑定c++17开始支持
        cout << k << ':' << v << endl;

    vector<string> fruit = { "苹果","香蕉","苹果","西瓜","香蕉","苹果" };
    map<string, int> count;
    for (auto e : fruit)
        count[e]++;
    for (const auto& e : count)
    {
        cout << e.first << ':' << e.second << endl;
    }
    string str;
    while (cin >> str)//由key值找value
    {
        map<string, string>::iterator tmp = dict.find(str);
        if (tmp != dict.end()) cout << tmp->second << endl;
        else cout << "没有这个单词，重新来" << endl;
    }
    return 0;
}